package com.dongdongshop.service.impl;
import com.dongdongshop.mapper.TbTypeTemplateMapper;
import com.dongdongshop.pojo.TbTypeTemplate;
import com.dongdongshop.pojo.TbTypeTemplateExample;
import com.dongdongshop.service.TbTypeTemplateServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class TbTypeTemplateServiceImpl implements TbTypeTemplateServiceI {

    @Autowired
    private TbTypeTemplateMapper tbTypeTemplateMapper;

    @Override
    @Transactional //事物
    public List<TbTypeTemplate> getFindAll(String name) {
        return tbTypeTemplateMapper.getFindAll(name);
    }

    @Override
    @Transactional //事物
    public void saveTbTypeTemplate(TbTypeTemplate tbTypeTemplate) {
        tbTypeTemplateMapper.insertSelective(tbTypeTemplate);
    }

    @Override
    @Transactional //事物
    public void deleteTbTypeTemplate(String id) {
        tbTypeTemplateMapper.deleteTbTypeTemplate(id);
    }

    @Override
    @Transactional //事物
    public TbTypeTemplate selectTbTypeTemplateById(Integer id) {
        return tbTypeTemplateMapper.selectByPrimaryKey(id.longValue());
    }

    @Override
    @Transactional //事物
    public void updateTbTypeTemplate(TbTypeTemplate tbTypeTemplate) {
        tbTypeTemplateMapper.updateByPrimaryKeySelective(tbTypeTemplate);
    }

    @Override
    @Transactional //事物
    public List<TbTypeTemplate> getFiandsAll() {
        return tbTypeTemplateMapper.selectByExample(new TbTypeTemplateExample());
    }

}
